package com.qf.listener;

import com.event.EventListener;
import com.qf.entity.PricesParams;
import com.qf.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrdersEventListener implements EventListener<PricesParams> {

    @Autowired
    private ISearchService iSearchService;

    @Override
    public String eventType() {
        return "create_orders";
    }

    @Override
    public void eventHandler(PricesParams pricesParams) {
        System.out.println("接收到下单请求："+pricesParams);
        iSearchService.updateRoomNumber(pricesParams);
    }
}
